const Redis = require("ioredis")

const redis = new Redis({
  host:"localhost",
  port:6379,
  password:'password',
  db:0
})

redis.on('err',err=>{
    if(err){
        console.log('Redis连接错误');
        console.log(err);
        redis.quit()
    }
})

redis.on('ready',()=>{
    console.log('Redis 连接成功');
})

module.exports = redis